package com.ktwlsoft.archivemanage.domain.dao.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Size;

/**
  * role--角色
  *
  * @author zhuhe on 2019-10-24 14:19:43
  * @version 1.0
  */
@ApiModel("role--角色-Role")
@Getter
@Setter
public class Role extends BaseEntity {

    /**角色名称**/
    @ApiModelProperty("角色名称")
    @Size(max = 30, message = "角色名称参数超长")
    private String roleName;

    /**权限(使用半角逗号隔开各个权限名称)**/
    @ApiModelProperty("权限(使用半角逗号隔开各个权限名称)")
    @Size(max = 500, message = "权限(使用半角逗号隔开各个权限名称)参数超长")
    private String rights;

    /**备注**/
    @ApiModelProperty("备注")
    @Size(max = 100, message = "备注参数超长")
    private String remark;

    /**状态(NORMAL(正常), DELETED(删除), FORBIDDEN(禁用))**/
    @ApiModelProperty("状态(NORMAL(正常), DELETED(删除), FORBIDDEN(禁用))")
    @Size(max = 30, message = "状态(NORMAL(正常), DELETED(删除), FORBIDDEN(禁用))参数超长")
    private STATE state;

    @ApiModelProperty("是否系统默认")
    private Boolean systemDefault = false;

    public Role(){

    }

    public Role(String roleName, String remark){
        this.roleName = roleName;
        this.remark = remark;
        this.state = STATE.NORMAL;
    }

    public enum STATE {
        NORMAL,
        DELETED,
        FORBIDDEN
    }
}
